import 'package:environmental_les_app/common/style/colours.dart';
import 'package:flutter/material.dart';

class SurroundingUnitsItem extends StatelessWidget {
  final Map<String, dynamic> data;

  const SurroundingUnitsItem({super.key, required this.data});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.only(bottom: 12),
      padding: const EdgeInsets.all(14),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(10),
        boxShadow: const [
          BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2))
        ],
      ),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Text(data['name'] ?? '',
                    style: const TextStyle(
                        fontSize: 16, fontWeight: FontWeight.w600)),
                const SizedBox(height: 8),
                Row(
                  children: [
                    Container(
                      padding: const EdgeInsets.symmetric(
                          horizontal: 6, vertical: 2),
                      decoration: BoxDecoration(
                        color: Colours.bgF4F7FE,
                        borderRadius: BorderRadius.circular(4),
                        border: Border.all(color: Colours.lineB7C0D7),
                      ),
                      child: Text(data['type'] ?? '',
                          style: const TextStyle(
                              color: Colours.appMain, fontSize: 13)),
                    ),
                  ],
                ),
                const SizedBox(height: 10),
                Row(
                  children: [
                    const Icon(Icons.location_on_outlined,
                        size: 16, color: Colours.text09C),
                    const SizedBox(width: 6),
                    Expanded(
                        child: Text(data['address'] ?? '',
                            style: const TextStyle(
                                color: Colours.text09C, fontSize: 13)))
                  ],
                ),
              ],
            ),
          ),
          const SizedBox(width: 8),
          const Icon(Icons.chevron_right, color: Colours.text254),
        ],
      ),
    );
  }
}
